package com.example.a1.fannong.ui.shoppingcart;

import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;

import com.example.a1.fannong.R;
import com.example.a1.fannong.core.app.BaseActivity;

import cn.personal.library.viewinject.FindViewById;
import cn.personal.library.viewinject.OnClick;
import cn.personal.library.viewinject.ViewInjecter;

public class PaymentActivity extends BaseActivity {

    @FindViewById(R.id.wec_select_rb)
    private CheckBox wecRb;
    @FindViewById(R.id.pay_select_rb)
    private CheckBox payRb;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_payment);
        ViewInjecter.inject(this);
    }

    @OnClick({R.id.pay_bt ,R.id.wec_select_rb, R.id.pay_select_rb})
    public void onItemClick(View view) {
        switch (view.getId()) {
            case R.id.pay_bt:
                if (wecRb.isChecked()){
                    showToast("微信支付。。。。");
                }else {
                    showToast("支付宝支付。。。。");
                }
                break;
            case R.id.wec_select_rb:
                wecRb.setChecked(true);
                payRb.setChecked(false);
                break;
            case R.id.pay_select_rb:
                wecRb.setChecked(false);
                payRb.setChecked(true);
                break;
        }
    }
}
